  //返回值 0-360正整数
  function angle(x1, y1, x2, y2) {
            let xCha = x2 - x1;
            let yCha = y2 - y1;
            //坐标二位于坐标一xy轴左上方
            if (x2 < x1 && y2 < y1) {
                return Math.abs(parseInt(Math.round(Math.asin(Sin(xCha, yCha)) / (Math.PI / 180))));
            }//坐标二位于坐标一xy轴右上方 
            else if (x2 > x1 && y2 < y1) {
            
                return 90 + 90 - Math.abs(parseInt(Math.round(Math.asin(Sin(xCha, yCha)) / (Math.PI / 180))));
            }//坐标二位于坐标一xy轴右下方
             else if (x2 > x1 && y2 > y1) {
                
                return 180 + Math.abs(parseInt(Math.round(Math.asin(Sin(xCha, yCha)) / (Math.PI / 180))));
            }//坐标二位于坐标一xy轴左下方
            else if (x2 < x1 && y2 > y1) {
                return 270 +  90 - Math.abs(parseInt(Math.round(Math.asin(Sin(xCha, yCha)) / (Math.PI / 180))));
            }
        }
        //求sin值
        function Sin(a, b) {
            return b / Math.sqrt(a * a + b * b);
        }
        //测试代码
        console.log(angle(100, 100, 50, 0));
        console.log(angle(100, 100, 150, 0));
        console.log(angle(100, 100, 150, 20));
        console.log(angle(100, 100, 200, 150));
        console.log(angle(100, 100, 50, 150));